package com.ruoyi.web.controller.agoniappWeb;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.pojo.entity.TodoEvent;
import com.ruoyi.system.service.IAgoniTodoEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.core.domain.AjaxResult.success;

@RestController
@RequestMapping("/pages/todo/")
public class TodoEventWebController {

    //注入事件Service
    @Autowired
    private IAgoniTodoEventService eventService;

    /**
     * TODO: 事件相关接口
     * 1:获取所有事件列表
     */
    @GetMapping("listTodo")
    public AjaxResult getAllEvents() {

        //TODO: 获取所有事件列表
      List<TodoEvent> events = eventService.getAllTodoEventsCommon();
        //TODO: 返回事件列表
        System.out.println("events:" + events);

        return success(events);
    }

}
